#ifndef NBODIES
#define NBODIES

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <mpi.h>
#include <string.h>

#define X 0
#define Y 1

struct acc{
  float x;
  float y;
};

struct speed{
  float x;
  float y;
};

struct body{
  float m;
  float x;
  float y;
  struct speed * speed;
  struct acc * new_acc;
  float close_x;
  float close_y;
  float close_m;
  float close_dst;
};

//Definition des fonctions
float dst(struct body * a, float x,float y);
float unit(int dir,struct body * a,float x,float y);
void print(struct body ** bodies, int nb_bodies);
struct body ** parse(char * path,int * nb_bodies,int rank);
int calc(float *buffer, struct body **bodies, int nb_bodies, int first, int iter);
int maj(struct body ** bodies, int nb_bodies, float dt);
float maj_dt(struct body ** bodies, int nb_bodies, float dt);
void printToFile(struct body ** bodies, int nb_bodies, int proc,int flag);
#endif
